// hyb_yl/doctorHome/pages/index/index.js
var app= getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    suifang:[],
    fuwu:"",
    page:0,
    result_list:[
      {
        photo:"../../img/tab_img1.png",
        name:"蔡文姬",
        sex:"男",
        age:"24",
        num:'一',
        time:"2021-04-08",
        list:['PICC术后','起搏器','心衰'],
        state:1
      },
      {
        photo:"../../img/tab_img1.png",
        name:"蔡文姬",
        sex:"男",
        age:"24",
        num:'二',
        time:"2021-04-08",
        list:['PICC术后','起搏器','心衰'],
        state:2
      },
      {
        photo:"../../img/tab_img1.png",
        name:"蔡文姬",
        sex:"男",
        age:"24",
        num:'三',
        time:"2021-04-08",
        list:['PICC术后','起搏器','心衰'],
        state:3
      }
    ],
    lab_index:1
  },
  lab_btn:function(e){
    var index=e.currentTarget.dataset.index;
    this.setData({
      lab_index:index
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this;
    that.getSuifang();
  },
  // 获取随访列表
  getSuifang:function(){
    var that = this;
    app.util.request({
      'url':"entry/wxapp/follow.zhuanjia_suifang",
      data:{
        openid:wx.getStorageSync('openid'),
        page:that.data.page
      },
      success:function(res)
      {
        that.setData({
          suifang:that.data.suifang.concat(res.data),
          page:that.data.page + 1,
        })
      }
    })
  },
  // 获取医生服务包
  getfuwu:function(){
    var that = this;
    app.util.request({
      'url':"entry/wxapp/green.getsh_type",
      data:{
        openid:wx.getStorageSync('openid'),
        zid:wx.getStorageSync('zid'),
        success:function(res)
        {
          that.setData({
            fuwu:res.data,
          })
        }
      }
    })
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})